﻿using EFCore.Models;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SIService;
using SService;

namespace WMSWeb.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class InventorydetailsController : ControllerBase
    {
        private readonly WmssystemContext myDb;
        private readonly InventorydetailsS inventorydetailsS;

        public InventorydetailsController(WmssystemContext myDb, SService.InventorydetailsS inventorydetailsS)
        {
            this.myDb = myDb;
            this.inventorydetailsS = inventorydetailsS;
        }
        /// <summary>
        /// 入库明细查询
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<List<PO_Inventorydetails>> Qu()
        {
            return await  inventorydetailsS.Qu();
        }
        /// <summary>
        /// 入库明细添加
        /// </summary>
        /// <returns></returns>
        /// 
        [HttpPost]
        public async Task<int> Add(PO_Inventorydetails pO_Inventorydetails)
        {
            return await inventorydetailsS.Add(pO_Inventorydetails);
        }
        /// <summary>
        /// 入库明细删除
        /// </summary>
        /// <returns></returns>
        /// 
        [HttpDelete]
        public async Task<int> Del(int id)
        {
            return await inventorydetailsS.Del(id);
        }
    }
}
